import request from '@/utils/request'
export function RoleSearch(data) {
  return request({
    url: '/Role/Search',
    method: 'post',
    data
  })
}

export function Role(method, value) {
  let url = ''
  let data = null

  if (method === 'PUT') {
    url = '/Role/' + value.id
    data = value.value
  } else if (method === 'POST') {
    url = '/Role'
    data = value
  }
  return request({
    url,
    method,
    data
  })
}

export function RoleDetail(data) {
  return request({
    url: '/Role/' + data.id,
    method: 'get'
  })
}

export function RoleDel(data) {
  return request({
    url: '/Role/' + data.id,
    method: 'delete'
  })
}
